<!DOCTYPE html>
<html><head>
	    <meta charset="utf-8">
    <title>ThinkPHP5.0</title>

    <meta name="description" content="Dashboard">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__ADMIN__/style/bootstrap.css" rel="stylesheet">
    <link href="__ADMIN__/style/font-awesome.css" rel="stylesheet">
    <link href="__ADMIN__/style/weather-icons.css" rel="stylesheet">

    <!--Beyond styles-->
    <link id="beyond-link" href="__ADMIN__/style/beyond.css" rel="stylesheet" type="text/css">
    <link href="__ADMIN__/style/demo.css" rel="stylesheet">
    <link href="__ADMIN__/style/typicons.css" rel="stylesheet">
    <link href="__ADMIN__/style/animate.css" rel="stylesheet">
    <script src="__ADMIN__/style/jquery_002.js"></script>
    <script src="__ADMIN__/plus/layer/layer.js"></script>
    <script src="__ADMIN__/plus/uploadify/jquery.uploadify.min.js"></script>
    <script src="__ADMIN__/plus/ueditor/ueditor.config.js"></script>
    <script src="__ADMIN__/plus/ueditor/ueditor.all.min.js"></script>
    <script src="__ADMIN__/plus/ueditor/lang/zh-cn/zh-cn.js"></script>  
</head>
<body>
	<!-- 头部 -->
	{include file="common/head"}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			<!-- Page Sidebar -->
                {include file="common/left"}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                                        <li>
                        <a href="#">系统</a>
                    </li>
                                        <li>
                        <a href="#">文档管理</a>
                    </li>
                                        <li class="active">所属栏目</li>
                                        </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-header bordered-bottom bordered-blue">
                <span class="widget-caption">所属栏目</span> 
            </div>
            <div class="widget-body">
                <div id="horizontal-form">
                    <form class="form-horizontal" action="{:url('Content/add')}" method="get" enctype="multipart/form-data" >
                        <div class="form-group">
                            <label for="group_id" class="col-sm-2 control-label no-padding-right">所属栏目</label>
                            <div class="col-sm-6">
                               <select name="cate_id">
                                   <option value="">请选择</option>
                                   {volist name="cateRes" id="cate"}
                                    <option value="{$cate.id}"><?php echo str_repeat('-', $cate['level']*8);?>{$cate.cate_name}</option>
                                   {/volist}
                               </select>
                               <input name="model_id" type="hidden" value="">
                            </div>
                        </div>  
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button onclick="return checkval();" type="submit" class="btn btn-default">下一步</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    <script src="__ADMIN__/style/bootstrap.js"></script>
    <!--Beyond Scripts-->
    <script src="__ADMIN__/style/beyond.js"></script>
    <script type="text/javascript">
        $("select[name='cate_id']").change(function(){
            var cateid=$(this).val();
            $.ajax({
                type:"post",
                dataType:"json",
                data:{cateid:cateid},
                url:"{:url('Content/ajaxGetModelId')}",
                success:function(data){
                    $("input[name='model_id']").val(data);
                }
             });
        });
        
        function checkval(){
            var options=$("select[name='cate_id'] option:selected");
            if(!options.val()){
                alert('请选择一个栏目');
                return false;
            }else{
                return true;
            }

        }
    </script>
    

</body></html>